_base_ = [
    "../_base_/datasets/face_license_4gpu_addjson_deploy.py",
    "../_base_/default_runtime.py",
]
model = dict(
    type="GFL",
    pretrained="/workspace/volume/wangxianzhuo-data/prune/my_prune/workdir/exp41/finetuned.pth",
    backbone=dict(
        type="MobileNetV2_combined_no_relu_origin",
        # sparsity=0.5
        return_layers=["2", "4", "7", "14"],
        inverted_residual_setting=[
            # t, c, n, s
            [1, 16, 1, 1],
            [3, 16, 1, 2],  # down 2
            [72 / 16, 16, 1, 1],
            [72 / 16, 29, 1, 2],  # down 4
            [96 / 29, 29, 2, 1],
            [96 / 29, 60, 1, 2],  # down 7
            [192 / 60, 60, 3, 1],
            [192 / 60, 83, 1, 1],
            [288 / 83, 83, 2, 1],
            [288 / 83, 140, 1, 1],  # down 14
            [480 / 140, 140, 2, 1],
            [480 / 140, 160, 1, 1],
        ],
        input_channel=32,
        last_channel=1280,
    ),
    neck=dict(
        type="FPN_NIL_slim_noitpl",
        in_channels=[16, 29, 60, 140],
        out_channels=64,
        start_level=0,
        end_level=3,
        add_extra_convs="on_output",
        num_outs=3,
    ),
    bbox_head=dict(
        type="GFLHeadSepConvDS_slim",
        norm_cfg=dict(type="BN"),
        num_classes=2,
        num_ins=3,
        in_channels=64,
        stacked_convs=3,
        feat_channels=64,
        anchor_generator=dict(
            type="AnchorGenerator",
            ratios=[1.0],
            octave_base_scale=2,
            scales_per_octave=1,
            strides=[4, 8, 16],
        ),
        loss_cls=dict(
            type="QualityFocalLoss", use_sigmoid=True, beta=2.0, loss_weight=1.0
        ),
        loss_dfl=dict(type="DistributionFocalLoss", loss_weight=0.25),
        reg_max=3,
        integral_sparse=2,
        loss_bbox=dict(type="GIoULoss", loss_weight=2.0),
    ),
)
# training and testing settings
train_cfg = dict(
    assigner=dict(type="ATSSAssigner", topk=9),
    allowed_border=-1,
    pos_weight=-1,
    debug=False,
)
test_cfg = dict(
    nms_pre=1000,
    min_bbox_size=0,
    score_thr=0.05,
    nms=dict(type="nms", iou_thr=0.6),
    max_per_img=100,
)
# optimizer
optimizer = dict(type="SGD", lr=0.01, momentum=0.9, weight_decay=0.0001)
optimizer_config = dict(grad_clip=dict(max_norm=35, norm_type=2))
# learning policy
lr_config = dict(
    policy="step", warmup="linear", warmup_iters=500, warmup_ratio=0.001, step=[16, 22]
)
total_epochs = 24

seed = 166
find_unused_parameters = True
